  <div class="form-container">
    <form name="myForm" class="el-form">
      <div ng-repeat="field in fields"
        ng-class="{'form-group': true, 'is-error': myForm[field.name].$invalid,'is-required': field.required}"
        ng-switch="field.type"
        class="el-form-item">
        <label for="{{field.id}}" class="el-form-item__label" ng-style="{ 'width': labelWidth }">{{field.label}}</label>
        <div ng-switch-when="text" class="el-form-item__content" ng-style="{ 'margin-left': labelWidth }">
          <el-input ng-model="field.value" placeholder="请输入内容" disabled="{{field.use.disabled}}" clearable="true">
          </el-input>
          <div class="el-form-item__error"></div>
        </div>
        <div ng-switch-when="select" class="el-form-item__content" ng-style="{ 'margin-left': labelWidth }">
          <el-select options="field.options" selected="field.value" label="label" value="value" placeholder="请选择" disabled="{{field.use.disabled}}">
          </el-select>
          <div class="el-form-item__error"></div>
        </div>
        <div ng-switch-when="checkbox" class="el-form-item__content" ng-style="{ 'margin-left': labelWidth }">
          <checkbox-group options="field.options" ng-model="field.value" disabled="{{field.use.disabled}}"></checkbox-group>
          <div class="el-form-item__error"></div>
        </div>
        <div ng-switch-when="radio" class="el-form-item__content" ng-style="{ 'margin-left': labelWidth }">
          <radio-group options="field.options" ng-model="field.value" disabled="{{field.use.disabled}}"></radio-group>
          <div class="el-form-item__error"></div>
        </div>
        <div ng-switch-when="date" class="el-form-item__content" ng-style="{ 'margin-left': labelWidth }">
          <el-date-picker date="field.value" placeholder="选择日期" on-change="onDateChange(date)" disabled="{{field.use.disabled}}">
          </el-date-picker>
          <div class="el-form-item__error"></div>
        </div>
        <div ng-switch-when="switch" class="el-form-item__content" ng-style="{ 'margin-left': labelWidth }">
          <el-switch ng-model="field.value" active-color="#13ce66" disabled="{{field.use.disabled}}">
          </el-switch>
          <div class="el-form-item__error"></div>
        </div>
      </div>
      <button type="submit" class="form-btn" ng-click="onSubmit()">Submit</button>
    </form>
  </div>